package edu.nf.exam.service.impl;

import edu.nf.exam.dao.QuestionContentInfoDao;
import edu.nf.exam.dao.impl.QuestionContentInfoDaoImpl;
import edu.nf.exam.entity.QuestionContentInfo;
import edu.nf.exam.exception.DataAcessException;
import edu.nf.exam.service.QuestionContentService;

/**
 * @Author : QYM
 * @create 2021/6/17
 * 题目内容信息表（单选题，多选题，判断题）--业务接口实现类
 */
public class QuestionContentServiceImpl implements QuestionContentService {
    /**
     * 添加
     * @param questionContentInfo
     */
    @Override
    public void checkAdd(QuestionContentInfo questionContentInfo) {
        try {
            QuestionContentInfoDao dao=new QuestionContentInfoDaoImpl();
            dao.add(questionContentInfo);
        } catch (Exception e) {
            e.printStackTrace();
            throw new DataAcessException("添加失败");
        }
    }

    /**
     * 修改
     * @param questionContentInfo
     */
    @Override
    public void checkUpdate(QuestionContentInfo questionContentInfo) {
        try {
            QuestionContentInfoDao dao=new QuestionContentInfoDaoImpl();
            dao.update(questionContentInfo);
        } catch (Exception e) {
            e.printStackTrace();
            throw new DataAcessException("修改失败");
        }
    }
}
